const { ipcMain } = require("electron");

// 窗口最小化
const mini = win => {
    ipcMain.on('event-win-mini', () => {
        win.minimize()  // 窗口最小化实例方法, 参考官方文档
    })
}

// 窗口最大化
const max = win => {
    ipcMain.on('event-win-max', () => {
        win.maximize()
    })
}

// 取消窗口最大化
const cancelMax = win => {
    ipcMain.on('event-win-cancelMax', () => {
        win.unmaximize()
    })
}

// 关闭窗口
const closeWin = win => {
    ipcMain.on('event-win-closeWin', () => {
        win.hide()
    })
}

module.exports = {
    mini,
    max,
    cancelMax,
    closeWin,
}
